package xyz.liut.crash;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;

import xyz.liut.liutlibraries.baseclass.BaseActivity;

/**
 * @author Liut
 * @date 2016/7/20
 */
public class CrashActivity extends BaseActivity implements DialogInterface.OnClickListener {

    public static String EXTRA_EX;
    private Throwable ex;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ex = (Throwable) getIntent().getSerializableExtra(EXTRA_EX);
        new AlertDialog.Builder(this)
                .setTitle("我们遇到了一些问题")
                .setMessage(ex.getMessage())
                .setPositiveButton("yes", CrashActivity.this)
                .setCancelable(false)
                .show();
    }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        finish();
    }
}
